@tool
extends  EditorProperty

const TAG_TREE_COMP = preload("res://addons/gameplay-ability-system/Scripts/Inspector/components/tag_comp/TagTreeComp.tscn")


func _ready() -> void:
	var tag_tree_comp = TAG_TREE_COMP.instantiate()
	var tag_tree = get_edited_object() as TagTree
	tag_tree_comp.source_tree = tag_tree.tree
	tag_tree_comp.tree_update.connect(_on_tree_update)
	
	add_child(tag_tree_comp)
	set_bottom_editor(tag_tree_comp)
	


func _on_tree_update(tree:Dictionary):
	var tag_tree = get_edited_object() as TagTree
	tag_tree.tree = tree
